/*!
Sistema Integral Foncreagro
 */

Ext.define('MyDesktop.AccordionWindow', {
    extend: 'Ext.ux.desktop.Module',

    requires: [
        'Ext.data.TreeStore',
        'Ext.layout.container.Accordion',
        'Ext.toolbar.Spacer',
        'Ext.tree.Panel'
    ],

    id:'acc-win',

    init : function(){
        this.launcher = {
            text: 'Recursos Humanos',
            iconCls:'accordion'
        };
    },


    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('rrhh');
        
        var ancho = Escritorio.Funciones.Ancho({desktop : desktop});
        var alto = Escritorio.Funciones.Alto({desktop : desktop});
        
        if (!win) {
            var smc = Escritorio.RRHH.Inicio();
            win = desktop.createWindow({
                id: 'rrhh',
                title: 'RECURSOS HUMANOS',
                width: ancho,
                height: alto,
                iconCls: 'accordion',
                animCollapse: false,
                constrainHeader: true,
                bodyBorder: false,
                border: false,
                layout: 'fit',
                items: [smc]
            });
        }
        else {
            win.setWidth(ancho);
            win.setHeight(alto);
        }        

        return win;
    }
});
